import Vue from './vue.js'

window.vm = new Vue({
  el:'#app',
  data:{
    msg: 'hello zhaowa',
    userInfo: {
      name: 'lucy'
    }
  },
  beforeCreate (){
    console.log('life-cycle--- beforeCreate')
  },
  created (){
    console.log('life-cycle--- created')
  },
  beforeMount (){
    console.log('life-cycle--- beforeMount')
  },
  mounted (){
    console.log('life-cycle--- mounted')
  },
  beforeUpdate (){
    console.log('life-cycle--- beforeUpdate')
  },
  updated (){
    console.log('life-cycle--- updated')
  },
  methods:{
    changeMsg (){
      this.msg = 'msg is change'
      console.log(this.msg)
    },
    changeMsg1 (){
      this.userInfo.name = 'liu fang'
      this.msg = 'liu fang'
      console.log(this.msg)
    }
  }
})

window.addEventListener('error',(e)=>{
  console.log('window 报错:')
  console.log(e)
})
console.log(vm)